<template>
    <h1>用户投资赎回列表</h1>

    <table class="table table-bordered" border="1" >
        <thead>
            <tr>
                <th>投资项目编号</th>
                <th>账号名称</th>
                <th>投资项目总金额</th>
                <th>用户已投金额</th>
                <th>赎回金额</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for=" item in info " >
                <td>{{ item.I_Id }}</td>
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.I_Budget }}</td>
                <td>{{ item.UT_Money }}</td>
                <td>{{ item.UIR_Money }}</td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';

const info = ref([{
    I_Id:'',
    I_Name:'',
    I_Budget:'',
    UT_Money:'',
    UIR_Money:'',
    UL_Name:''
}])

const route = useRoute();

console.log(route.params.Id);

onMounted (()=>{
    SearUserInvestRedeemInfo();
})

const SearUserInvestRedeemInfo = ()=>{
    axios({
        url:"http://localhost:56707/api/Invest/SearUserInvestRedeemInfo",
        method:"get",
        params:{
            Id:route.params.Id
        }
    })
    .then(res=>{
        console.log(res.data);
        info.value = res.data;
    })
    .catch(err=>{
        console.log(err);
    })
}


</script>
